package com.gaogzhen.datastructure.queue;

import java.util.Arrays;
import java.util.Random;

/**
 * @author Administrator
 * @date 2022-12-10 19:33
 */
public class TestIndexPq {
    public static void main(String[] args) {
        IndexPriorityQueue<Integer> ipq = new IndexPriorityQueue<Integer>(20, (o1, o2) -> o2.compareTo(o1), true);
//        Random random = new Random();
//        int[] a = new int[10];
//        for (int i = 0; i < 10; i++) {
//            a[i] = random.nextInt(1000);
//        }
        int[] a = {317, 430, 734, 880, 105, 536, 536, 813, 48, 806};
        for (int i = 0; i < a.length; i++) {
            ipq.insert(i, a[i]);
        }
//        System.out.println(Arrays.toString(a));

//        ipq.increaseVal(9, 881);
        System.out.println(ipq);
        ipq.changeVal(1, 1);
        System.out.println(ipq);
//        for (Integer integer : ipq) {
//            System.out.println(integer);
//        }
    }
}
